<template>
	<view class="index">
		<!-- #ifdef H5 -->
		<YouRan-UI-WeiXinNei-TiShi></YouRan-UI-WeiXinNei-TiShi>
		<!-- #endif -->
		<template v-if="JSON.stringify(XiaoXu_XinXi) != '{}'">
			<view class="BenYe-ZhaiYao">
				<view class="Zuo">
					<image :src="XiaoXu_XinXi.cover" mode="widthFix"></image>
				</view>
				<view class="You">
					<view class="ZhaiYao">{{XiaoXu_XinXi.description}}</view>
				</view>
			</view>
		</template>
		<!-- 悠然-UI-DIY - 组件 -->
		<YouRan-UI-DIY
			v-if="YouRan_UI_DIY_ZhuangTai"
			:PeiZhi_WenJian="PeiZhi_WenJian"
			:XiaoZu_Gid="gid"></YouRan-UI-DIY>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				gid:"",
				XiaoXu_XinXi:{},
				PeiZhi_WenJian:"_Lie_XiaoZu.json",// [ ！很重要！] 请求哪个 Json 文件
				YouRan_UI_DIY_ZhuangTai:false,// YouRan-UI-DIY 组件的状态，用来重载
			}
		},
		onShow() {
			
		},
		onLoad(e) {
			this.gid = e.gid;
			// 本小组详情
			this.QingQiu_Ben_XiaoZu_XiangQing();
		},
		methods: {
			// 本小组详情
			QingQiu_Ben_XiaoZu_XiangQing(){
				this.$_QingQiu(
					"GET","/api/v2/group/"+this.gid+"/detail",{},
					(res) => {
						uni.setNavigationBarTitle({ title:res.data.data.detail.gname })
						this.XiaoXu_XinXi = res.data.data.detail;
						// DIY 组件
						this.QingQiu_DIY_ZuJian();
					}
				)
			},
			// DIY 组件
			QingQiu_DIY_ZuJian(){
				uni.request({
					url:`${this.$_PeiZhi_WenJian()}_Lie_XiaoZu_${this.gid}.json`,
					method:'GET',
					success: (res) => {
						if(typeof(res.data) == 'string'){
							this.PeiZhi_WenJian = `_Lie_XiaoZu.json`;
							this.YouRan_UI_DIY_ZhuangTai = true;
						}else{
							this.PeiZhi_WenJian = `_Lie_XiaoZu_${this.gid}.json`;
							this.YouRan_UI_DIY_ZhuangTai = true;
						}
					}
				})
			}
		}
	}
</script>

<style lang="scss">
.index{
	.BenYe-ZhaiYao{
		display: flex;
		padding: 25rpx;
		background: $BeiJingSe;
		border-bottom: 1rpx solid $BianKuangSe;
		.Zuo{
			width: 100rpx;
			height: 100rpx;
			overflow: hidden;
			border-radius: 100%;
			flex-shrink: 0;
		}
		.You{
			margin: 0 0 0 25rpx;
			flex: 1;
			.ZhaiYao{
				color: $ZhanWeiSe;
				font-size: 28rpx;
				line-height: 40rpx;
			}
		}
	}
}
</style>